package Decorator;

public class DecoratorPatternDemo {
    /*
    我们创建一个 Shape 接口 和 实现了 Shape 接口的实体类.
    然后创建一个实现了 Shape 接口的  抽象装饰类 ShapeDecorator, 并把 Shape 对象作为它的实例变量.
     */

    public static void main(String[] args) {

        Shape circle = new Circle();
        ShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());

        System.out.println("Circle with normal border");
        circle.draw();  // 最常规的 画⚪

        System.out.println("\n Circle with red Border");
        redCircle.draw();  // 圆圈 + 红色

        System.out.println("\n Rectangle with red Border ");
        redRectangle.draw();  // 长方体 + 红色



    }
}
